#include "vic_reg.h"

void vic_init(int num, u32 isr){
    u32 VICVECTADDR;

    if(num < 32){
        VICINTENCLEAR_CH0 = (1 << num);
        VICVECTADDR = BASE_ADDR_CH0 + 0x100 + num * 4;
        VICINTENABLE_CH0 |= (1 << num);
    }else{
        num -= 32;
        VICINTENCLEAR_CH1 = (1 << num);
        VICVECTADDR = BASE_ADDR_CH1 + 0x100 + num * 4;
        VICINTENABLE_CH1 |= (1 << num);
    }

    __REG(VICVECTADDR) = isr;

}